(define (sum term a next b)
    (if (> a b)
        0
        (+ 
            (term a)
            (sum term (next a) next b))))

(define (sum-cubes a b)
    (sum cube a inc b))

(define (inc i) (+ i 1))

(define (cube x) (* x x x))



